/*
 * Reader.h
 * Loads the model data from disk.
 *
 */
#ifndef _READER_H_
#define _READER_H_

#include <string>
#include <vector>

#include "Model.h"
#include "Vector.h"

class Reader
{
public:
	Reader(const std::string &filename);

	Model read() const;

private:
	unsigned int rock_count(std::ifstream &input) const;

	Vector read_vector(std::ifstream &input) const;

	inline Vector read_rock(std::ifstream &input) const
	{
		return this->read_vector(input);
	}

	std::vector< Vector > read_rocks(std::ifstream &input, unsigned int count) const;
	City read_city(std::ifstream &input) const;

	Trajectory read_trajectory(std::ifstream &input) const;
	double read_threshold(std::ifstream &input) const;

	std::string _filename;
};

#endif /* _READER_H_ */

